/**
 * Copyright 2009 University of  Washington
 * This code is released under the GPL version 3 - with a copy of the license included
 * @author Maya Hao Li
 *
 */
package seedpod.webapp.view;

import java.util.Vector;

@Deprecated
public class ErrorMessage {
	private Vector<String> _errorMsg = new Vector<String>();
	private String _elementId;
	public ErrorMessage( String id	) {
		_elementId = id;
	}

	public ErrorMessage(String id, String msg) {
		_elementId = id;
		_errorMsg.add( msg );
	}
	
	public void addMsg( String msg) {
		_errorMsg.add(msg);
	}

	public String toHtml() {
		StringBuffer out = new StringBuffer();
		out.append( "<div class=\"errorBox\" id=" + _elementId + ">" );
		for ( int i = 0; i < _errorMsg.size(); i++ ) {
			out.append( _errorMsg.elementAt( i ) );
			out.append( HtmlUtil.NL() );
		}
		out.append( "</div>" );
		return out.toString();
	}
	

}
